home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: netcom.com!simg
- From: simg@netcom.com (SimGraphics)
- Subject: Re: Watcom C/C++ Gurus: Please Help.
- Message-ID: <simgDL3LtF.HH5@netcom.com>
- Reply-To: sylvek@simg.com
- Organization: SimGraphics Engineering, South Pasadena, California
- References: <4d4mvi$a13@victoria.pe.net>
- Date: Sat, 13 Jan 1996 02:34:27 GMT
- Sender: simg@netcom7.netcom.com
-
- Here is the simple solution for your problem:
-
- 1) using the documentation and debugger find the layout of the stack
- frame of your interrupt procedure.
-
- 2) You can take the address of the local integer variable on stack with the
- & operator and assign it to an int * variable
-
- 3) Knowing the layout of stack frame you can find the offset (in words)
- between saved segment register and your int variable.
-
- 4) Add this offset to your int * variable
-
- 5) Use this pointer to patch the saved register on the stack frame
-
- That is it.
-
- Good luck,
-
- Sylvester
-